'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    const { INTEGER, DATE, STRING, TEXT, FLOAT } = Sequelize;
    await queryInterface.createTable('purchases', {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      store_name: STRING(255),
      in_store_date: DATE,
      user_name: STRING(512),
      telephone: STRING(255),
      address: STRING(512),
      model: STRING(512),
      out_no: STRING(512),
      back_cause: TEXT,
      back_no: STRING(512),
      num: INTEGER,
      price: FLOAT,
      reject_price: FLOAT,
      status: STRING(255),
      back_date: DATE,
      remark: TEXT,
      template1: TEXT,
      template2: STRING(512),
      template3: STRING(512),
      template4: INTEGER,
      created_at: DATE,
      updated_at: DATE,
    });
  },

  async down(queryInterface) {
    await queryInterface.dropTable('purchases');
  },
};
